﻿using System;
using System.Collections.Generic;
using System.Text;
using System.Windows.Forms;

namespace Rung.Soft.Jx3Tookit.Addon.AutoPress.Utility
{
    [Serializable]
    public class HotKey
    {
        public Keys Key;

        public static HotKey NoneKey { get { return HotKey.FromByte(0); } }

        public HotKey(Keys k)
        {
            this.Key = k;
        }

        public override string ToString()
        {
            return Enum.GetName(typeof(Keys), this.Key);
        }

        public byte ToByte()
        {
            return (byte)this.Key;
        }

        public static HotKey FromByte(byte b)
        {
            return new HotKey((Keys)b);
        }

        public static HotKey[] GetKeys()
        {
            return new HotKey[] { 
                new HotKey(Keys.D0),
                new HotKey(Keys.D1),
                new HotKey(Keys.D2),
                new HotKey(Keys.D3),
                new HotKey(Keys.D4),
                new HotKey(Keys.D5),
                new HotKey(Keys.D6),
                new HotKey(Keys.D7),
                new HotKey(Keys.D8),
                new HotKey(Keys.D9),
                new HotKey(Keys.A),
                new HotKey(Keys.B),
                new HotKey(Keys.C),
                new HotKey(Keys.D),
                new HotKey(Keys.E),
                new HotKey(Keys.F),
                new HotKey(Keys.G),
                new HotKey(Keys.H),
                new HotKey(Keys.I),
                new HotKey(Keys.G),
                new HotKey(Keys.K),
                new HotKey(Keys.L),
                new HotKey(Keys.M),
                new HotKey(Keys.N),
                new HotKey(Keys.O),
                new HotKey(Keys.P),
                new HotKey(Keys.Q),
                new HotKey(Keys.R),
                new HotKey(Keys.S),
                new HotKey(Keys.T),
                new HotKey(Keys.U),
                new HotKey(Keys.V),
                new HotKey(Keys.W),
                new HotKey(Keys.X),
                new HotKey(Keys.Y),
                new HotKey(Keys.Z),
                new HotKey(Keys.D0),
                new HotKey(Keys.D1),
                new HotKey(Keys.D2),
                new HotKey(Keys.D3),
                new HotKey(Keys.D4),
                new HotKey(Keys.D5),
                new HotKey(Keys.D6),
                new HotKey(Keys.D7),
                new HotKey(Keys.D8),
                new HotKey(Keys.D9),
                new HotKey(Keys.F1),
                new HotKey(Keys.F2),
                new HotKey(Keys.F3),
                new HotKey(Keys.F4),
                new HotKey(Keys.F5),
                new HotKey(Keys.F6),
                new HotKey(Keys.F7),
                new HotKey(Keys.F8),
                new HotKey(Keys.F9),
                new HotKey(Keys.F10),
                new HotKey(Keys.F11),
                new HotKey(Keys.F12)
            };
        }
    }
}
